/**
 * Created by 鄢鹏权 on 2017/04/08.
 */
namespace Castle {
    export class Cache {
        static set(key: string, value: string) {
            window.localStorage.setItem(key, value);
        }

        static get(key: string) {
            return window.localStorage.getItem(key)
        }

        static getSet(key: string, value: string) {
            let s = this.get(key);
            this.set(key, value);
            return s;
        }

        static del(key: string) {
            window.localStorage.removeItem(key)
        }

        static getDel(key: string) {
            let s = this.get(key);
            this.del(key);
            return s;
        }

        static clear() {
            window.localStorage.clear()
        }
    }
}